// Copyright 2022 jeff.li. and/or its affiliates.


#include <tbir/runtime/container.h>
#include <tbir/runtime/container_private.h>
#include <tbir/runtime/ft_container.h>
#include <tbir/runtime/registry.h>

namespace tbir::runtime {

    TBIR_REGISTER_GLOBAL("runtime.RTValue_GetTypeCode").set_body([](PyArgs args) -> RTValue {
        MXCHECK_EQ(args.size(), 1) << "[runtime.RTValue_GetTypeCode] Expect 1 arguments but get "
                                   << args.size();
        return args[0].type_code();
    });

    TBIR_REGISTER_GLOBAL("runtime.RTValue_Repr").set_body([](PyArgs args) -> RTValue {
        MXCHECK(1 == args.size()) << "RuntimeObjectRepr expect " << 1 << " arguments but get "
                                  << args.size();
        std::stringstream os;
        os << args[0];
        return StringHelper::Decode(os.str());
    });

}  // namespace tbir::runtime
